package com.niiwoo.civet.user.service;

import com.niiwoo.civet.user.dto.request.AFPCallbackDTO;
import com.niiwoo.civet.user.dto.request.LaunchSpeedLoanCreditRequestDTO;
import com.niiwoo.civet.user.dto.request.SpeedLoanCreditCallbackDTO;
import com.niiwoo.civet.user.dto.response.*;
import com.niiwoo.civet.user.enums.CreditEnum;

import java.math.BigDecimal;

/**
 * @Description: 用户授信服务
 * @Author:LiJian
 * @Date:2017/11/7
 */
public interface UserCreditDubboService {


    /**
     * 发起极速借授信反欺诈
     * @param creditRequest
     * @return
     */
    LaunchSpeedLoanCreditDTO launchSpeedLoanCredit(LaunchSpeedLoanCreditRequestDTO creditRequest);

    /**
     * 获取用户极速借授信信息
     * @param userId 用户id
     * @return
     */
    UserSpeedCreditInfoDTO getUserSpeedCreditInfo(String userId);

    /**
     * 极速借授信反欺诈回调处理
     * @param afpCallbackDTO
     * @return
     */
    void speedLoanCreditAgainstFakeHandle(AFPCallbackDTO afpCallbackDTO);

    /**
     * 极速借授信回调处理
     * @param speedLoanCreditCallback
     * @return
     */
    void speedLoanCreditHandle(SpeedLoanCreditCallbackDTO speedLoanCreditCallback);

    /**
     * 获取极速借用户授信资料状态
     * @param userId
     * @return
     */
    UserCreditDataStatusDTO getUserCreditDataStatusDTO(String userId);

    int isOldUser(String userId);

    /**
     * 是否第二次借款
     *
     * @param userId
     * @return
     */
    boolean isSecondLoan(String userId);


    /**
     * 获取用户授权过程信息
     * @param userId
     * @param creditAmountType
     * @return
     */
    UserCreditProcessStatusDTO getUserCreditProcessStatus(String userId, CreditEnum.CreditAmountType creditAmountType);

    /**
     * 用户授信改成需要更新
     * @param userId
     * @param creditAmountType
     */
    void changeCreditNeedUpdate(String userId, CreditEnum.CreditAmountType creditAmountType);

    //public void queryEducation(String userId);
    void educationAuth(String userId);

    /**
     * 查询用户是否需要更新额度
     * @param userId
     */
    UserCreditInfoDTO getUserCreditInfoByType(String userId);

    /**
     * 获取卡牛的授信额度
     * @param userId
     * @param creditAmountType
     * @return
     */
    UserCreditInfoDTO findCreditAmount(String userId, CreditEnum.CreditAmountType creditAmountType);

    default public void pushCreditEventToActivity(String userId,BigDecimal creditAmount){};

    default MobileRealNameResponseDTO queryMobileRealNameForTiancheng(String realName, String identityCard, String mobilePhone,String userId){
        throw new UnsupportedOperationException("方法未实现");
    }


}
